<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>绝对定位</title>
    <style>
        body{
            position: relative;
        }
        .f{
            border: 1px solid #000;
            margin: 10px;
        }
        .f4{
            position: relative;
        }
        .f3{
            position: relative;
        }
        .f2{
            position: relative;
        }
        .f1{
            position: relative;
        }
        .s{
            width: 30px;
            height: 30px;
            background-color: #f00;
            position: absolute;
            top: 0px;
            left: 0px;
        }
    </style>
</head>
<body>
    <div class="f f4">
        <div class="f f3">
            <div class="f f2">
                <div class="f f1">
                    <div class="s"></div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
